package com.wy2cloud.authorize.repository;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import com.wy2cloud.authorize.entity.AuthorizeUser;

/**
 * 授权用户的仓储层
 * @author wuyy<16349023@qq.com>,nnsword
 * @date 2018年4月4日下午1:12:48
 *
 */
public interface AuthorizeUserRepository extends JpaRepository<AuthorizeUser, String> {
	
	@Query("select u from AuthorizeUser u where u.email=?1 and u.password=?2")
	AuthorizeUser login(String email, String password);

	AuthorizeUser findByEmailAndPassword(String email, String password);

	AuthorizeUser findUserByEmail(String email);
	
	AuthorizeUser findUserByName(String name);
	
	AuthorizeUser findUserByAccount(String account);
}
